3.733 \(\int \frac{(a+b \sin (e+f x))^2}{\sqrt{c+d \sin (e+f x)}} \, dx\)

Optimal. Leaf size=203 \[ \frac{2 \left (d^2 \left (3 a^2+b^2\right )+2 b c (b c-3 a d)\right ) \sqrt{\frac{c+d \sin (e+f x)}{c+d}} F\left (\frac{1}{2} \left (e+f x-\frac{\pi }{2}\right )|\frac{2 d}{c+d}\right )}{3 d^2 f \sqrt{c+d \sin (e+f x)}}-\frac{4 b (b c-3 a d) \sqrt{c+d \sin (e+f x)} E\left (\frac{1}{2} \left (e+f x-\frac{\pi }{2}\right )|\frac{2 d}{c+d}\right )}{3 d^2 f \sqrt{\frac{c+d \sin (e+f x)}{c+d}}}-\frac{2 b^2 \cos (e+f x) \sqrt{c+d \sin (e+f x)}}{3 d f} \]

[Out]

(-2*b^2*Cos[e + f*x]*Sqrt[c + d*Sin[e + f*x]])/(3*d*f) - (4*b*(b*c - 3*a*d)*EllipticE[(e - Pi/2 + f*x)/2, (2*d
)/(c + d)]*Sqrt[c + d*Sin[e + f*x]])/(3*d^2*f*Sqrt[(c + d*Sin[e + f*x])/(c + d)]) + (2*((3*a^2 + b^2)*d^2 + 2*
b*c*(b*c - 3*a*d))*EllipticF[(e - Pi/2 + f*x)/2, (2*d)/(c + d)]*Sqrt[(c + d*Sin[e + f*x])/(c + d)])/(3*d^2*f*S
qrt[c + d*Sin[e + f*x]])

________________________________________________________________________________________

Rubi [A]  time = 0.28484, antiderivative size = 203, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {2791, 2752, 2663, 2661, 2655, 2653} \[ \frac{2 \left (d^2 \left (3 a^2+b^2\right )+2 b c (b c-3 a d)\right ) \sqrt{\frac{c+d \sin (e+f x)}{c+d}} F\left (\frac{1}{2} \left (e+f x-\frac{\pi }{2}\right )|\frac{2 d}{c+d}\right )}{3 d^2 f \sqrt{c+d \sin (e+f x)}}-\frac{4 b (b c-3 a d) \sqrt{c+d \sin (e+f x)} E\left (\frac{1}{2} \left (e+f x-\frac{\pi }{2}\right )|\frac{2 d}{c+d}\right )}{3 d^2 f \sqrt{\frac{c+d \sin (e+f x)}{c+d}}}-\frac{2 b^2 \cos (e+f x) \sqrt{c+d \sin (e+f x)}}{3 d f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[e + f*x])^2/Sqrt[c + d*Sin[e + f*x]],x]

[Out]

(-2*b^2*Cos[e + f*x]*Sqrt[c + d*Sin[e + f*x]])/(3*d*f) - (4*b*(b*c - 3*a*d)*EllipticE[(e - Pi/2 + f*x)/2, (2*d
)/(c + d)]*Sqrt[c + d*Sin[e + f*x]])/(3*d^2*f*Sqrt[(c + d*Sin[e + f*x])/(c + d)]) + (2*((3*a^2 + b^2)*d^2 + 2*
b*c*(b*c - 3*a*d))*EllipticF[(e - Pi/2 + f*x)/2, (2*d)/(c + d)]*Sqrt[(c + d*Sin[e + f*x])/(c + d)])/(3*d^2*f*S
qrt[c + d*Sin[e + f*x]])

Rule 2791

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> -Simp[
(d^2*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*(m + 2)), Int[(a + b*Sin[e + f*x
])^m*Simp[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c,
d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] &&  !LtQ[m, -1]

Rule 2752

Int[((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[(b*c
 - a*d)/b, Int[1/Sqrt[a + b*Sin[e + f*x]], x], x] + Dist[d/b, Int[Sqrt[a + b*Sin[e + f*x]], x], x] /; FreeQ[{a
, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]

Rule 2663

Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[Sqrt[(a + b*Sin[c + d*x])/(a + b)]/Sqrt[a
+ b*Sin[c + d*x]], Int[1/Sqrt[a/(a + b) + (b*Sin[c + d*x])/(a + b)], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a
^2 - b^2, 0] &&  !GtQ[a + b, 0]

Rule 2661

Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2*EllipticF[(1*(c - Pi/2 + d*x))/2, (2*b)
/(a + b)])/(d*Sqrt[a + b]), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]

Rule 2655

Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[Sqrt[a + b*Sin[c + d*x]]/Sqrt[(a + b*Sin[c +
 d*x])/(a + b)], Int[Sqrt[a/(a + b) + (b*Sin[c + d*x])/(a + b)], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 -
 b^2, 0] &&  !GtQ[a + b, 0]

Rule 2653

Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2*Sqrt[a + b]*EllipticE[(1*(c - Pi/2 + d*x)
)/2, (2*b)/(a + b)])/d, x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]

Rubi steps

\begin{align*} \int \frac{(a+b \sin (e+f x))^2}{\sqrt{c+d \sin (e+f x)}} \, dx &=-\frac{2 b^2 \cos (e+f x) \sqrt{c+d \sin (e+f x)}}{3 d f}+\frac{2 \int \frac{\frac{1}{2} \left (3 a^2+b^2\right ) d-b (b c-3 a d) \sin (e+f x)}{\sqrt{c+d \sin (e+f x)}} \, dx}{3 d}\\ &=-\frac{2 b^2 \cos (e+f x) \sqrt{c+d \sin (e+f x)}}{3 d f}-\frac{(2 b (b c-3 a d)) \int \sqrt{c+d \sin (e+f x)} \, dx}{3 d^2}+\frac{1}{3} \left (3 a^2+b^2+\frac{2 b c (b c-3 a d)}{d^2}\right ) \int \frac{1}{\sqrt{c+d \sin (e+f x)}} \, dx\\ &=-\frac{2 b^2 \cos (e+f x) \sqrt{c+d \sin (e+f x)}}{3 d f}-\frac{\left (2 b (b c-3 a d) \sqrt{c+d \sin (e+f x)}\right ) \int \sqrt{\frac{c}{c+d}+\frac{d \sin (e+f x)}{c+d}} \, dx}{3 d^2 \sqrt{\frac{c+d \sin (e+f x)}{c+d}}}+\frac{\left (\left (3 a^2+b^2+\frac{2 b c (b c-3 a d)}{d^2}\right ) \sqrt{\frac{c+d \sin (e+f x)}{c+d}}\right ) \int \frac{1}{\sqrt{\frac{c}{c+d}+\frac{d \sin (e+f x)}{c+d}}} \, dx}{3 \sqrt{c+d \sin (e+f x)}}\\ &=-\frac{2 b^2 \cos (e+f x) \sqrt{c+d \sin (e+f x)}}{3 d f}-\frac{4 b (b c-3 a d) E\left (\frac{1}{2} \left (e-\frac{\pi }{2}+f x\right )|\frac{2 d}{c+d}\right ) \sqrt{c+d \sin (e+f x)}}{3 d^2 f \sqrt{\frac{c+d \sin (e+f x)}{c+d}}}+\frac{2 \left (3 a^2+b^2+\frac{2 b c (b c-3 a d)}{d^2}\right ) F\left (\frac{1}{2} \left (e-\frac{\pi }{2}+f x\right )|\frac{2 d}{c+d}\right ) \sqrt{\frac{c+d \sin (e+f x)}{c+d}}}{3 f \sqrt{c+d \sin (e+f x)}}\\ \end{align*}

Mathematica [A]  time = 0.905828, size = 173, normalized size = 0.85 \[ -\frac{2 \left (\left (3 a^2 d^2-6 a b c d+b^2 \left (2 c^2+d^2\right )\right ) \sqrt{\frac{c+d \sin (e+f x)}{c+d}} F\left (\frac{1}{4} (-2 e-2 f x+\pi )|\frac{2 d}{c+d}\right )-2 b (c+d) (b c-3 a d) \sqrt{\frac{c+d \sin (e+f x)}{c+d}} E\left (\frac{1}{4} (-2 e-2 f x+\pi )|\frac{2 d}{c+d}\right )+b^2 d \cos (e+f x) (c+d \sin (e+f x))\right )}{3 d^2 f \sqrt{c+d \sin (e+f x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[e + f*x])^2/Sqrt[c + d*Sin[e + f*x]],x]

[Out]

(-2*(b^2*d*Cos[e + f*x]*(c + d*Sin[e + f*x]) - 2*b*(c + d)*(b*c - 3*a*d)*EllipticE[(-2*e + Pi - 2*f*x)/4, (2*d
)/(c + d)]*Sqrt[(c + d*Sin[e + f*x])/(c + d)] + (-6*a*b*c*d + 3*a^2*d^2 + b^2*(2*c^2 + d^2))*EllipticF[(-2*e +
 Pi - 2*f*x)/4, (2*d)/(c + d)]*Sqrt[(c + d*Sin[e + f*x])/(c + d)]))/(3*d^2*f*Sqrt[c + d*Sin[e + f*x]])

________________________________________________________________________________________

Maple [B]  time = 2.608, size = 695, normalized size = 3.4 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(f*x+e))^2/(c+d*sin(f*x+e))^(1/2),x)

[Out]

(-(-d*sin(f*x+e)-c)*cos(f*x+e)^2)^(1/2)*(b^2*(-2/3/d*(-(-d*sin(f*x+e)-c)*cos(f*x+e)^2)^(1/2)+2/3*(c/d-1)*((c+d
*sin(f*x+e))/(c-d))^(1/2)*(d*(1-sin(f*x+e))/(c+d))^(1/2)*((-sin(f*x+e)-1)*d/(c-d))^(1/2)/(-(-d*sin(f*x+e)-c)*c
os(f*x+e)^2)^(1/2)*EllipticF(((c+d*sin(f*x+e))/(c-d))^(1/2),((c-d)/(c+d))^(1/2))-4/3*c/d*(c/d-1)*((c+d*sin(f*x
+e))/(c-d))^(1/2)*(d*(1-sin(f*x+e))/(c+d))^(1/2)*((-sin(f*x+e)-1)*d/(c-d))^(1/2)/(-(-d*sin(f*x+e)-c)*cos(f*x+e
)^2)^(1/2)*((-c/d-1)*EllipticE(((c+d*sin(f*x+e))/(c-d))^(1/2),((c-d)/(c+d))^(1/2))+EllipticF(((c+d*sin(f*x+e))
/(c-d))^(1/2),((c-d)/(c+d))^(1/2))))+4*a*b*(c/d-1)*((c+d*sin(f*x+e))/(c-d))^(1/2)*(d*(1-sin(f*x+e))/(c+d))^(1/
2)*((-sin(f*x+e)-1)*d/(c-d))^(1/2)/(-(-d*sin(f*x+e)-c)*cos(f*x+e)^2)^(1/2)*((-c/d-1)*EllipticE(((c+d*sin(f*x+e
))/(c-d))^(1/2),((c-d)/(c+d))^(1/2))+EllipticF(((c+d*sin(f*x+e))/(c-d))^(1/2),((c-d)/(c+d))^(1/2)))+2*a^2*(c/d
-1)*((c+d*sin(f*x+e))/(c-d))^(1/2)*(d*(1-sin(f*x+e))/(c+d))^(1/2)*((-sin(f*x+e)-1)*d/(c-d))^(1/2)/(-(-d*sin(f*
x+e)-c)*cos(f*x+e)^2)^(1/2)*EllipticF(((c+d*sin(f*x+e))/(c-d))^(1/2),((c-d)/(c+d))^(1/2)))/cos(f*x+e)/(c+d*sin
(f*x+e))^(1/2)/f

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b \sin \left (f x + e\right ) + a\right )}^{2}}{\sqrt{d \sin \left (f x + e\right ) + c}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))^2/(c+d*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate((b*sin(f*x + e) + a)^2/sqrt(d*sin(f*x + e) + c), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (-\frac{b^{2} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2}}{\sqrt{d \sin \left (f x + e\right ) + c}}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))^2/(c+d*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

integral(-(b^2*cos(f*x + e)^2 - 2*a*b*sin(f*x + e) - a^2 - b^2)/sqrt(d*sin(f*x + e) + c), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b \sin{\left (e + f x \right )}\right )^{2}}{\sqrt{c + d \sin{\left (e + f x \right )}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))**2/(c+d*sin(f*x+e))**(1/2),x)

[Out]

Integral((a + b*sin(e + f*x))**2/sqrt(c + d*sin(e + f*x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b \sin \left (f x + e\right ) + a\right )}^{2}}{\sqrt{d \sin \left (f x + e\right ) + c}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))^2/(c+d*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

integrate((b*sin(f*x + e) + a)^2/sqrt(d*sin(f*x + e) + c), x)